home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / DESK / CORE / Desk / h_doc / Resource < prev    next >
C/C++ Source or Header  |  1996-05-21  |  4KB  |  116 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Resource.h
  12.     Author:  Copyright © 1992, 1993, 1994 Jason Williams
  13.     Version: 1.02 (Dec 1994)
  14.     Purpose: Resource file (files within user application directory)
  15.              management functions
  16.     Mods:    Julian Smith 20 Mar 1995
  17.              Added function veneers to global vars if _desklib_DLL is
  18.              defined.
  19. */
  20.  
  21.  
  22. #ifndef __Desk_Resource_h
  23. #define __Desk_Resource_h
  24.  
  25. #ifdef __cplusplus
  26.     extern "C" {
  27. #endif
  28.  
  29. #ifndef __Desk_Core_h
  30.     #include "Desk.Core.h"
  31. #endif
  32.  
  33. #ifndef __Desk_Sprite_h
  34.     #include "Desk.Sprite.h"
  35. #endif
  36.  
  37.  
  38. #ifdef Desk__using_SDLS
  39.   extern char        *Desk_Resource__Ref_pathname( void);
  40.   extern Desk_sprite_area *Desk_Resource__Ref_sprites ( void);
  41. #endif
  42.  
  43. #if defined( Desk__using_SDLS) && !defined( Desk__making_Resource)
  44.   #define Desk_resource_pathname Desk_Resource__Ref_pathname()
  45.   #define Desk_resource_sprites  (*Desk_Resource_Ref_sprites())
  46. #else
  47.   extern char Desk_resource_pathname[32];
  48. /*
  49.  * This string is used as a prefix for all pathnames in DSEdit that load
  50.  * resource files. It is set up by either of the following calls, to be either
  51.  *   "<Name$Dir>."
  52.  * or
  53.  *   "Name:"
  54.  * It is prepended to a leafname (e.g. <Floob$Dir>.Sprites or Floob:Sprites)
  55.  * by some Desklib modules in order to find the resources.
  56.  * (See Misc.c.ResInit, Misc.c.ResInitPth to see exactly what these very
  57.  * simple functions do)
  58.  */
  59.  
  60.   extern Desk_sprite_area Desk_resource_sprites;
  61. #endif
  62.  
  63.  
  64.  
  65.  
  66. extern void Desk_Resource_Initialise(const char *respath);
  67.   /*
  68.    * Initialises the resource manager. Pass in the name of your application
  69.    * (e.g. if you have set <appname$Dir>, pass in "appname")
  70.    * This tells all DeskLib modules where to look for your resources
  71.    * by setting Desk_resource_pathname to "<Appname$Dir>." - this is prepended
  72.    * to all leafnames to create full resource pathnames.
  73.    * This pathname is used by various DeskLib modules (Template, Msgs, etc)
  74.    * -it adds very little code size to your program, and saves you the
  75.    * work of doing the pathname yourself. It also makes changing the
  76.    * resource directory at a later development stage far easier.
  77.    *
  78.    * This also calls Desk_dll_NameApp if the caller is a DLL client
  79.    *
  80.    * See also the ALTERNATIVE call, Desk_Resource_InitialisePath()
  81.    */
  82.  
  83.  
  84. extern void Desk_Resource_InitialisePath(const char *respath);
  85.   /*
  86.    * Initialises the resource manager.
  87.    *
  88.    * If you prefer to use a path variable for your resources (for easier
  89.    * setting of language resources), then you can initialise the resources
  90.    * by calling this function.
  91.    * (Instead of setting the resource prefix to "<AppName$Dir>.", it will
  92.    *  set it to "AppName:", where "AppName" is the 'respath' parameter)
  93.    *
  94.    * See also the ALTERNATIVE call, Desk_Resource_Initialise()
  95.    */
  96.  
  97.  
  98. extern void Desk_Resource_LoadSprites(void);
  99.   /*
  100.    * Loads the programs 'Sprites' file from the resource path, ready for use.
  101.    * Notes: Call this only after you have Desk_Resource_Initialise
  102.    *        To use these sprites for your templates, call
  103.    *          Desk_Template_UseSpriteArea(Desk_resource_sprites);
  104.    *        after calling this function.
  105.    * If you do not call this function, the 'Desk_resource_sprites' area will
  106.    * indicate the wimp sprite area.
  107.    */
  108.  
  109.  
  110. #ifdef __cplusplus
  111. }
  112. #endif
  113.  
  114.  
  115. #endif
  116.